//go:build linux

/*
 * @Author: soso
 * @Date: 2022-02-08 16:16:11
 * @LastEditTime: 2022-03-01 12:41:43
 * @LastEditors: Please set LastEditors
 * @Description:
 * @FilePath: /sync-client/notify/notify_linux.go
 */

package notify

import (
// "gitee.com/kimsoso/go-utils/sonotify"
// "time"
)

// 新增一条目录改动
// func (s *Snotifies) Add(act, path string) {
// 	s.Lock()
// 	defer s.Unlock()

// 	if path == "" || strings.HasSuffix(path, defines.DirFlagFile) {
// 		return
// 	}

// 	if act == sonotify.ActCreate {
// 		s.createTagFile(path)
// 	}

// 	ntfs := NewNtfs()
// 	if isRename, fromPath := s.isRename(act, path); !isRename {
// 		ntfs.Add(act, path)
// 	} else {
// 		if comm.SendRename(fromPath, path) != nil {
// 			ntfs.Add(act, path)
// 		}
// 	}
// }

// linux版本
// func (s *Snotifies) isRename(act, path string) (isRename bool, fromPath string) {
// 	isRename = false
// 	if act != sonotify.ActCreate {
// 		return
// 	}

// 	ntfs := NewNtfs()
// 	acts := ntfs.GetNtfs()
// 	if len(acts) > 0 && acts[len(acts)-1].Act == sonotify.ActRename && acts[len(acts)-1].Ctime.Unix() == time.Now().Unix() {
// 		isRename = true
// 		fromPath = acts[len(acts)-1].Path
// 		return
// 	}
// 	return
// }
